import axios from "axios";
import store from "@/store/modules/login";
const requset = axios.create({
    // 基础路径接口
    baseURL: "https://apipc-xiaotuxian-front.itheima.net",
    headers: {
        "Content-Type": "application/json"
    },
})

// 请求拦截器
requset.interceptors.request.use((config) => { // 做一些请求时的操作
    config.headers.Authorization = 'Bearer ' + store.state.isLogin
    return config
}, err => {
    return Promise.reject(err)
})

// 响应拦截器
requset.interceptors.response.use((res) => {
    return res
}, err => {
    return Promise.reject(err)
})
export default requset





